import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs';

import { User } from './user';

import { baseUrl } from '../config';

@Injectable()
export class AppService {

  constructor(private http: HttpClient) { };

  addUser(user): Observable<User> {
    return this.http.post<User>(`/api/user/createUser`, user)
  }

  getUser(user){
    return this.http.post(`/api/user/getUser`, user);
  }
}
